import request from '@/utils/request'

export function getArticlePage(query) {
  return request({
    url: '/cms/article/list',
    method: 'get',
    params: query
  })
}


export function addArticle(obj) {
  return request({
    url: '/cms/article',
    method: 'post',
    data: obj
  })
}

export function getArticle(id) {
  return request({
    url: '/cms/article/' + id,
    method: 'get'
  })
}

export function delArticle(id) {
  return request({
    url: '/cms/article/' + id,
    method: 'delete'
  })
}

export function putArticle(obj) {
  return request({
    url: '/cms/article',
    method: 'put',
    data: obj
  })
}

export function changeCategory(obj) {
  return request({
    url: '/cms/article/changeCategory',
    method: 'post',
    data: obj
  })
}

export function changeTop(obj) {
  return request({
    url: '/cms/article/changeTop',
    method: 'post',
    data: obj
  })
}
